package com.zero.domain;

import com.zero.common.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
    * 会员表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder    // 与@Builder的区别：子类可以使用链式方法 给父类属性赋值
public class Member extends BaseEntity {
    /**
    * 主键 会员ID
    */
    private Integer userId;

    /**
    * 会员账号
    */
    private String userName;

    /**
    * 密码
    */
    private String password;

    /**
    * 昵称
    */
    private String nickName;

    /**
    * 年龄
    */
    private Integer age;

    /**
    * 地址
    */
    private String address;

    /**
    * 性别(0:男  1::女)
    */
    private Integer sex;

    /**
    * 身份证号
    */
    private String cardId;

    /**
    * 电话号码
    */
    private String phone;

    /**
    * 积分
    */
    private Integer score;

    /**
    * 充值金额（单位：元）
    */
    private BigDecimal money;

    /**
    * 头像地址
    */
    private String avatar;

    /**
    * 用户类型(0:系统用户  1:普通用户)
    */
    private Integer userType;

    /**
    * 状态(是否用车中   0:未用车   1:用车中)
    */
    private Integer status;

    /**
    * 用户是否已删除  (0:未删除   1:已删除)
    */
    private Integer delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("password", getPassword())
                .append("nickName", getNickName())
                .append("age", getAge())
                .append("address", getAddress())
                .append("sex", getSex())
                .append("cardId", getCardId())
                .append("phone", getPhone())
                .append("score", getScore())
                .append("status ", getStatus())
                .append("money", getMoney())
                .append("avatar", getAvatar())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }


    /* @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", userName=").append(userName);
        sb.append(", password=").append(password);
        sb.append(", nickName=").append(nickName);
        sb.append(", age=").append(age);
        sb.append(", address=").append(address);
        sb.append(", sex=").append(sex);
        sb.append(", cardId=").append(cardId);
        sb.append(", phone=").append(phone);
        sb.append(", score=").append(score);
        sb.append(", money=").append(money);
        sb.append(", avatar=").append(avatar);
        sb.append(", userType=").append(userType);
        sb.append(", status=").append(status);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }*/
}
